import request from '@/utils/request'

// 查询订单商品明细列表
export function listOrderGoods(query) {
  return request({
    url: '/orderGoods/list',
    method: 'get',
    params: query
  })
}

// 查询订单商品明细详细
export function getOrderGoods(id) {
  return request({
    url: '/orderGoods/' + id,
    method: 'get'
  })
}

// 根据订单ID查询订单商品明细
export function getOrderGoodsByOrderId(orderId) {
  return request({
    url: '/orderGoods/orderId/' + orderId,
    method: 'get'
  })
}

// 新增订单商品明细
export function addOrderGoods(data) {
  return request({
    url: '/orderGoods',
    method: 'post',
    data: data
  })
}

// 修改订单商品明细
export function updateOrderGoods(data) {
  return request({
    url: '/orderGoods',
    method: 'put',
    data: data
  })
}

// 删除订单商品明细
export function delOrderGoods(id) {
  return request({
    url: '/orderGoods/' + id,
    method: 'delete'
  })
}
